package com.atguigu.gmall.activity.service.impl;

import com.atguigu.gmall.activity.mapper.CouponInfoMapper;
import com.atguigu.gmall.activity.service.CouponInfoService;
import com.atguigu.gmall.model.activity.CouponInfo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: zm
 * @Date: 2021/8/16 22:23
 */
@Service
public class CouponInfoServiceImpl implements CouponInfoService {

    @Autowired
    private CouponInfoMapper couponInfoMapper;

    // 获取优惠券列表
    @Override
    public List<CouponInfo> findCouponByKeyword(String keyWord) {
        QueryWrapper<CouponInfo> wrapper = new QueryWrapper<>();
        wrapper.like("coupon_name",keyWord);
        return couponInfoMapper.selectList(wrapper);
    }
}
